# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-mutagen
_pkgname=mutagen
pkgver=1.43.0
pkgrel=4
pkgdesc='Read and write audio tags for many formats.'
url='https://pypi.org/project/mutagen/#files'
arch=('any')
license=('GPL2')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('66df63705a43befa9cf6688bc8b3acc4fd1559eb28920c105b47a97c35422b5e19527051445daa7aed66facc2e4c14d71058f8560bbd564fecbe56a076491e3f')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done

  rm -rf "$pkgdir/usr/share"
}

